package List;

/**
 * Created with Intellij IDEA.
 * Description;
 * User:TQ02
 * Data:2024-02-25
 * Time:15:17
 * Text：链表题，两数相加
 */

public class Text1 {
    public ListNode addTwoNumbers(ListNode l1, ListNode l2) {
        ListNode t1=new ListNode(0);
        int num=0;
        ListNode t2=t1;
        while(l1 !=null || l2!=null || num!=0){
            if(l1!=null){
                num+=l1.val;
                l1=l1.next;
            }
            if(l2!=null){
                num+=l2.val;
                l2=l2.next;
            }
            t2.next=new ListNode(num%10);
            t2=t2.next;
            num/=10;
        }

        return t1.next;
    }
    public static void main(String[] args) {
        System.out.println(10%10);
    }
}
